#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
# Copyright © 2019 Parker Ellertson
# See LICENSE for more details

from urllib.request import urlopen
import json
import sys

try:
	urls = open("URLS", "r")
except IOError:
	sys.exit("The URLS file doesn't exist.")

for url in urls:
	json_data = json.load(urlopen(url))
	
	print(json_data['title'])
	for item in json_data['items'][0:10]:
		line = "\t{}\t{}".format(item['title'], item['url'])
		print(line)
	print("")
